:root {
    /* 深色主题变量 */
    --bg-primary: #1a2a3a;
    --bg-secondary: #2c3e50;
    --card-bg: rgba(61, 100, 114, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #a8d8ea;
    --accent-color: #4facfe;
    --accent-gradient: linear-gradient(to right, #4facfe, #00cbfe);
    --border-color: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(255, 255, 255, 0.12);
    --weekend-bg: rgba(61, 100, 114, 0.25);
    --today-bg: rgba(79, 172, 254, 0.2);
    --stat-card-bg: rgba(61, 100, 114, 0.4);
    --chart-bar: linear-gradient(to top, #4facfe, #00c3fe);
    --work-hour-good: #c3e6ab;
    --work-hour-medium: #ffd966;
    --work-hour-bad: #ff6b6b;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    --toggle-bg: linear-gradient(to right, #4facfe, #00cbfe);
    --scroll-button-hover: transparent
}

.light-theme {
    /* 浅色主题变量 */
    --bg-primary: #f0f5f9;
    --bg-secondary: #e0ebf5;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #444444;
    --text-secondary: #bbbbbb;
    --accent-color: #705697;
    --accent-gradient: linear-gradient(to right, #4e3c69, #705697);
    --border-color: #d0d7e3;
    --input-bg: rgba(0, 0, 0, 0.04);
    --weekend-bg: #c4b7d7;
    --today-bg: #ede8ef;
    --stat-card-bg: rgba(255, 255, 255, 0.9);
    --chart-bar: linear-gradient(to top, #4e3c69, #705697);
    --work-hour-good: #43a047;
    --work-hour-medium: #f57c00;
    --work-hour-bad: #e53935;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    --toggle-bg: linear-gradient(to right, #4e3c69, #705697);
    --scroll-button-hover: transparent

}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    color: var(--text-primary);
    padding: 20px;
    user-select: none;
}

.container {
    width: 100%;
    max-width: 1600px;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(12px);
    border-radius: 15px;
    overflow: hidden;
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--toggle-bg);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

/* 左侧日历区域 */
.calendar-section {
    flex: 1.8;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 右侧统计区域 */
.stats-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.month-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}
.title-container{
    display: flex;
    justify-content: space-between;
      margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.month-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
  
}

.title-button {
    font-weight: 700;
    padding: 12px 28px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50px;
    border: none;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.title-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}


table {
    border-collapse: collapse;
    width: 100%;
    overflow: hidden;
    table-layout: fixed;
}

th,
td {
    border: 1px solid var(--border-color);
    text-align: center;
    padding: 10px 5px;
    position: relative;
}

td {
    height: 95px;
    vertical-align: top;
}

td.active {
    background-color: rgba(61, 100, 114, 0.15);
}

th {
    background-color: rgba(61, 100, 114, 0.3);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 12px 5px;
}

.time-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 5px;
}

.time-inputs input {
    width: 100%;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.95em;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.time-inputs input:focus {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.2);
}

.time-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.date-num {
    font-weight: bold;
    font-size: 1.05rem;
    color: var(--text-primary);
    text-align: left;
    padding-left: 5px;
}

.weekend {
    background-color: var(--weekend-bg);
}

.today {
    position: relative;
    background-color: var(--today-bg);
}

.today .date-num::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.stat-card {
    width: 100%;
    background: var(--stat-card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-card h2 {
    margin-bottom: 20px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
}

.stat-card h2 i {
    font-size: 1.6rem;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    margin: 15px 0;
}

.stat-desc {
    text-align: center;
    color: var(--work-hour-good);
    font-size: 1.1rem;
}

.hide {
    display: none;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
}

.work-hour-display {
    font-size: 0.85rem;
    color: var(--work-hour-good);
    margin-top: 5px;
    font-weight: bold;
}

/* 图表容器样式 */
.chart-container {
    height: 260px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
}

.chart-zoom-controls {
    display: flex;
    gap: 10px;
}

.chart-scroll-controls {
    display: flex;
    gap: 10px;
}

.chart-control-btn {
    background: var(--scroll-button);
    color: var(--border-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s;
    font-size: 16px;
}

.chart-control-btn:hover {
    color: var(--text-primary);

    background: var(--scroll-button-hover);
    transform: scale(1.1);
}

.chart-bars-container {
    display: flex;
    height: 100%;
    gap: 8px;
    align-items: flex-end;
    transition: transform 0.3s ease;
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 30px;
}

.chart-bar {
    flex: 1;
    min-width: 8px;
    background: var(--chart-bar);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s ease;
}

.chart-bar:hover {
    background: var(--accent-color);
    opacity: 0.9;
}

.chart-label {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }

    .calendar-container {
        flex-direction: column;
        gap: 20px;
    }

    .month-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .time-inputs input {
        font-size: 0.75rem;
        padding: 4px;
    }

    td {
        height: 85px;
        padding: 8px 3px;
    }

    th {
        font-size: 0.9rem;
        padding: 8px 3px;
    }

    .toggle_button {
        width: 100%;
        justify-content: center;
    }
}